package io;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Li_DaChiZi
 * Date: 2025/7/4
 * Time: 12:34
 */
public class Demo13 {
    public static void main(String[] args) {
        try (Reader reader = new FileReader("./test.txt")){
            while (true) {
                int n = reader.read();
                if (n == -1) {
                    return;
                }
                char ch = (char) n;
                System.out.println(ch);
            }
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
